<html>
<head><meta charset="utf-8"><title>Span with start line greater than end line · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20with.20start.20line.20greater.20than.20end.20line.html">Span with start line greater than end line</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="238406851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20with%20start%20line%20greater%20than%20end%20line/near/238406851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20with.20start.20line.20greater.20than.20end.20line.html#238406851">(May 12 2021 at 01:23)</a>:</h4>
<p>I'm debugging an incremental compilation issue, and I've come across this span:<br>
<code>compiler/rustc_middle/src/query/mod.rs:1527:11: 234:25 (#1475)</code></p>
<p>Does anyone know how a <code>Span</code> like that could be created? As far as I can tell, all span creation eventually goes through <code>Span::new()</code>, which enforces that the <code>lo</code> position is actually less than the <code>hi</code> position.</p>



<a name="238408203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20with%20start%20line%20greater%20than%20end%20line/near/238408203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20with.20start.20line.20greater.20than.20end.20line.html#238408203">(May 12 2021 at 01:42)</a>:</h4>
<p>ah, I see - we always use the filename of the 'lo' bytepos when printing the span</p>



<a name="238408262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20with%20start%20line%20greater%20than%20end%20line/near/238408262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20with.20start.20line.20greater.20than.20end.20line.html#238408262">(May 12 2021 at 01:42)</a>:</h4>
<p>so a cross-file span will have line numbers from completely different files</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>